/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.wii.elpro.dao.hb;

import com.wii.elpro.dao.HibernateUtil;
import com.wii.elpro.dao.StandartSpecificationInterface;
import com.wii.elpro.entity.StandartSpecification;
import java.util.List;
import org.hibernate.Session;

/**
 *
 * @author hendro
 */
public class StandartSpecificationImpl extends DAOGenericImpl implements StandartSpecificationInterface{

    public StandartSpecification getStandartSpecification(long id) throws Exception {
        HibernateUtil.beginTransaction();
        Session em = HibernateUtil.getSession();
        try {
            return (StandartSpecification)em.load(StandartSpecification.class, id);
        } catch (Exception ex) {
            throw ex;
        }
    }

    public List<StandartSpecification> getStandartSpecifications() throws Exception {
        HibernateUtil.beginTransaction();
        Session em = HibernateUtil.getSession();
        try {
            return em.createQuery("SELECT d FROM StandartSpecification d").list();
        } catch (Exception ex) {
            throw ex;
        }
    }  
    
}
